home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / DYN401.ZIP / kernel / jumpto / jumpto.w < prev    next >
Text File  |  1995-08-08  |  846b  |  50 lines

  1.  
  2. /*  This routine works with WATCOM C/C++32 version 9.5 & 10.0
  3.     (See other jumpto.w* files for other configurations)
  4.     It uses the stack parameter passing convention (used by NLMs) and
  5.     no stack checking
  6.     compile with:
  7.         wcl386 -4s -c -I../include -zp2 -zq -oilrt -s file.c
  8. */
  9.  
  10.  
  11.  
  12. #ifdef    __cplusplus
  13. extern "C"  {
  14. #endif
  15.  
  16.  
  17.  
  18. typedef int     (*fun)();
  19.  
  20. void DB(void);
  21. void NDB(void);
  22.  
  23. #pragma aux DB = "add esp,14H" \
  24.                     "pop eax" \
  25.                     "pop ebp" \
  26.                     "add esp,0CH" \
  27.                     "jmp eax"
  28.  
  29. #pragma aux NDB = "add esp,8H" \
  30.                     "jmp eax"
  31.  
  32.  
  33. void    _jumpToMethod( fun f )
  34. {
  35.  
  36. /*      pop_this_stack_frame;   */
  37.  
  38. /*      pop previous (generics) stack frame  */
  39.  
  40.    NDB();
  41.  
  42. /*    (*f)();  */
  43.  
  44. }
  45.  
  46.  
  47. #ifdef    __cplusplus
  48. }
  49. #endif
  50.